﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace MoreExtentions
{
    public static partial class Linq
    {
        /// <summary>
        /// Selects distinct.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="V"></typeparam>
        /// <param name="source">The source.</param>
        /// <param name="selector">The selector.</param>
        /// <returns></returns>
        public static IEnumerable<V> SelectDistinct<T, V>(this IEnumerable<T> source, Func<T, V> selector)
        {
            return source.Select(selector).Distinct();
        }
    }
}